import $http from '@/utils/request'
export const dataApi = () => {
  return $http({
    url: '/admin/pest/getPestClassify',
    method: 'POST'
  })
}
// 有害生物列表
export const listApi = (data) => {
  return $http({
    url: '/admin/pest/getPests',
    method: 'POST',
    data
  })
}
// 新增有害生物
export const addPlantsApi = (data) => {
  return $http({
    url: '/admin/pest/setPest',
    method: 'POST',
    data
  })
}
// 删除有害生物类
export const delePlantsApi = (data) => {
  return $http({
    url: '/admin/pest/delPest',
    method: 'POST',
    data
  })
}

// 上传图片
export function imgAPI(file) {
  const data = new FormData()
  data.append('image', file)
  return $http({
    url: '/admin/common/uploadImage',
    method: 'post',
    data: data
  })
}
// 植物类列表
export const PlantsApi = (data) => {
  return $http({
    url: '/admin/plant/getPlants',
    method: 'POST',
    data
  })
}
// 植物种类统称
export const plantsCollectivelyApi = () => {
  return $http({
    url: '/admin/plant/getPlantUmbrellas',
    method: 'POST'
  })
}
// 添加植物
export const addplantApi = (data) => {
  return $http({
    url: '/admin/plant/setPlant',
    method: 'POST',
    data
  })
}
// 删除植物
export const deleplantApi = (data) => {
  return $http({
    url: '/admin/plant/delPlant',
    method: 'POST',
    data
  })
}
